#include <iostream>
#include <vector>

using namespace std;

const int N = 15, M = 1 << 12, mod = 1e8;

int n, m;
vector<int> head[M], state;
int g[N];
int f[N][M];

bool check(int x) {
    return !(x & x >> 1);
}

int main() {
    cin >> n >> m;
    
    for (int i = 1; i <= n; ++ i)
        for (int j = 0; j < m; ++ j) {
            int x;
            cin >> x;
            g[i] += (!x << j);
        }
    
    for (int i = 0; i < 1 << m; ++ i) 
        if (check(i))
            state.push_back(i);
    
    for (int i = 0; i < state.size(); ++ i)
        for (int j = 0; j < state.size(); ++ j) {
            int a = state[i], b = state[j];
            if ((a & b) == 0)
                head[i].push_back(j);
        }
        
    f[0][0] = 1;
    for (int i = 1; i <= n + 1; ++ i)
        for (int a = 0; a < state.size(); ++ a)
            for (int b : head[a]) {
                if (g[i] & state[a]) continue;
                f[i][a] = (f[i][a] + f[i - 1][b]) % mod;
            }
            
    cout << f[n + 1][0] << endl;
    
    return 0;
}